<?php 
	$host = "127.0.0.1";
	$userName = "root";
	$pwd = "root";
	$dbName = "text";
	$dbms='mysql';
	$dsn="$dbms:host=$host;dbname=$dbName";
	try {
		$db = new PDO($dsn,'root','root');
		//echo "连接成功。";
	} catch (Exception $exc) {
		//echo $exc->getMassage();
	}
	$db->query('set names utf8');
	$sql = "SELECT * FROM `class` where `checkID` = 0";
	$result = $db->query($sql);
	$result->setFetchMode(PDO::FETCH_ASSOC);
	$str = "";
	while($row=$result->fetch()){
		$str .= "<option value='".$row['id']."'>".$row['name']."</option>";
	}
	exit($str);
?>